﻿using System.Collections.Generic;

namespace dPet.Domain.Services
{
	using dPet.Domain.Models;

	public interface IInvoicingDomainService
	{
		/// <summary>
		/// 检测该商品条码是否与其他商品条码重名（同一Hospital下）
		/// </summary>
		bool HasSameProductBarcodeUnderHospital(string hospitalId, string barcode, Product currentProduct = null);

		/// <summary>
		/// 检测该大类是否与其他大类重名（同一Hospital下）
		/// </summary>
		bool HasSameCategoryNameUnderHospital(string hospitalId, string categoryName, ProductCategory currentCategory = null);

		/// <summary>
		/// 检测该小类是否与其他小类重名（同一大类下）
		/// </summary>
		bool HasSameSubCategoryNameUnderCategory(string categoryId, string subCategoryName, ProductSubCategory currentSubCategory = null);

		/// <summary>
		/// 根据批次进行商品入库
		/// </summary>
		/// <param name="batch"></param>
		void AddInventoryByBatch(InventoryBatch batch);

		/// <summary>
		/// 创建销售订单
		/// </summary>
		SaleOrder CreateSaleOrder(Hospital hospital, MembershipLevel membershipLevel, ICollection<ShoppingCartItem<Product>> shoppingCart, string @operator);

		/// <summary>
		/// 返还订单库存
		/// </summary>
		void ReturnInventoryByOrder(OrderBase order);
	}
}
